﻿CREATE PROCEDURE [Tips_insert]
	@P_1 Int,
	@P_2 NVarChar(max),
	@P_3 Int,
	@P_4 Int,
	@P_5 Bit,
	@sync_row_count Int OUTPUT
AS
BEGIN
SET @sync_row_count = 0; IF NOT EXISTS (SELECT * FROM [Tips_tracking] WHERE [TipID] = @P_1) BEGIN SET IDENTITY_INSERT [Tips] ON; INSERT INTO [Tips]([TipID], [TipText], [TipCategoryID], [WrittenByUserID], [Approved]) VALUES (@P_1, @P_2, @P_3, @P_4, @P_5);  SET @sync_row_count = @@rowcount; SET IDENTITY_INSERT [Tips] OFF; END 
END